{% extends "base.html" %}

{% block content %}

<script language=javascript>

function verify(form){
  if(form.name.value==""){
	alert("Enter the name please!");
	form.name.focus();		
       return false;
	}
  if(form.code.value==""){
	alert("Choose code please");
	form.code.focus();		
       return false;
	}

return true;
 }

</script>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<form name='form1' id='form1' action="/savegroups/" method='post' onsubmit='return verify(this);'>
<table width='650' class='grid' cellspacing='1' align='center'><tr><td colspan='2' class='title'>Add/Edit sales group</td></tr>
<tr valign='middle' align='left'></tr>

<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red">*</font>Name:</td>
<td class='even'><input type="text" name="name" value="{{grouplist.name}}" /></td></tr>
<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red">*</font>Code:</td>
<td class='even'><input type="text" name="code" value="{{grouplist.code}}"/></td></tr>
<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red">*</font>Chinese_Code:</td>
<td class='even'><input type="text" name="chinese" value="{{grouplist.chinese}}"/></td></tr>
{% if grouplist.id %}
<input type="hidden" name="id" value="{{grouplist.id}}" />
{% endif %}
<tr valign='middle' align='left'><td class='odd' width='25%'></td>
	<td class='even'>&nbsp;<input type='submit' class='button' name='submit'  id='submit' value=' Submit '  />&nbsp;&nbsp;
	{% if not grouplist.id %}
	<input type='reset' class='button' name='reset'  id='reset' value=' Reset ' />
	{% endif%}
	{% if grouplist.id %}
	<input type='button' class='button' name='back'  id='reset' value=' Back ' onclick="javascrip:history.back(1)" />
	{%endif%}
	</form>
	</td>
</tr>
{% if errormsg %}
<tr valign='middle' align='left'><td class='odd' width='25%'><font color="red">Error infomation</font></td>
<td class='even'><font color="red">{{errormsg}}</font></td></tr>
{% endif %}
</table>

{% endblock %}

